import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '../static/css/iconfont/1.0.0/index.css' /* icofont*/

// cssts
import '@/styles/index.scss' // global css
// 右键菜单
import contentmenu from 'v-contextmenu'
import 'v-contextmenu/dist/index.css'

import App from './App'

import router from './router'

import store from './store'

// Internationalization
import { global } from '@/global/global'
import { loadStyle } from './utils/util'
import { iconfontUrl, iconfontVersion } from '@/config/env'

import '@/icons' // icon

import '@/permission' // permission control

import * as filters from './filters' // global filters

//editor   npm install vue-quill-editor --save

import  VueQuillEditor from 'vue-quill-editor'  
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
//ie  npm install --save babel-polyfill
import 'babel-polyfill'
// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
Vue.use(contentmenu)
// Vue.use(ElementUI, { locale })
iconfontVersion.forEach(ele => {
  loadStyle(iconfontUrl.replace('$key', ele))
})
Vue.use(ElementUI)
// 加载用户主题
if (localStorage.getItem('themeValue')) {
  global.changeTheme(localStorage.getItem('themeValue'))
} else {
  global.changeTheme('default')
}
Vue.config.productionTip = false

Vue.use(VueQuillEditor)

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
